Method and system for allowing access to developed applications via a multi-tenant on-demand database service

ABSTRACT

In accordance with embodiments, there are provided mechanisms and methods for allowing access to developed applications via a multi-tenant on-demand database service, in a controlled environment. These mechanisms and methods for providing such access can enable embodiments to provide additional control over the development process as well as the access of such developed applications. The ability of embodiments to provide such additional control may lead to an improved application development framework, etc.

CLAIM OF PRIORITY

This application is a divisional of U.S. patent application Ser. No.11/859,498 entitled “METHOD AND SYSTEM FOR ALLOWING ACCESS TO DEVELOPEDAPPLICATIONS VIA A MULTI-TENANT ON-DEMAND DATABASE SERVICE,” by CraigWeissman, filed Sep. 21, 2007 (Attorney Docket No. SFC1P009/032), which,in turn, claims the benefit of U.S. Provisional Patent Application No.60/828,757 entitled “PROGRAMMING LANGUAGE METHOD AND SYSTEM FOREXTENDING APIS TO EXECUTE IN CONJUNCTION WITH AN ON-DEMAND DATABASESERVICE,” by Craig Weissman, filed Oct. 9, 2006 (Attorney Docket No.SFCIP009+/032PROV), the entire contents of which are incorporated hereinby reference. U.S. patent application Ser. No. 11/859,498 further claimsthe benefit of U.S. Provisional Patent Application No. 60/828,192entitled “PROGRAMMING LANGUAGE METHOD AND SYSTEM FOR EXTENDING APIS TOEXECUTE IN CONJUNCTION WITH AN ON-DEMAND DATABASE SERVICE,” by CraigWeissman, filed Oct. 4, 2006 (Attorney Docket No. SFC1P008+/032PROV),the entire contents of which are incorporated herein by reference.

COPYRIGHT NOTICE

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patent documentor the patent disclosure, as it appears in the Patent and TrademarkOffice patent file or records, but otherwise reserves all copyrightrights whatsoever.

FIELD OF THE INVENTION

The current invention relates generally to developer frameworks, andmore particularly to developing applications in an improved manner.

BACKGROUND

The subject matter discussed in the background section should not beassumed to be prior art merely as a result of its mention in thebackground section. Similarly, a problem mentioned in the backgroundsection or associated with the subject matter of the background sectionshould not be assumed to have been previously recognized in the priorart. The subject matter in the background section merely representsdifferent approaches, which in and of themselves may also be inventions.

In conventional database systems, users access their data resources inone logical database. A user of such a conventional system typicallyretrieves data from and stores data on the system using the user's ownsystems. A user system might remotely access one of a plurality ofserver systems that might in turn access the database system. Dataretrieval from the system might include the issuance of a query from theuser system to the database system. The database system might processthe request for information received in the query and send to the usersystem information relevant to the request.

There is often a desire to develop various applications for extendingcapabilities of the aforementioned database systems. To date, however,such applications have typically been developed in an uncontrolledenvironment. For example, developers conventionally dictate thedevelopment of such applications, leaving the database system servicewith less control. This, in turn, may lead to various shortcomings inthe development process, etc. For instance, various development bestpractices (e.g. with respect to testing, resource allocation, etc.) maynot necessarily be enforced, since they are under the control of thedeveloper.

BRIEF SUMMARY

In accordance with embodiments, there are provided mechanisms andmethods for allowing access to developed applications via a multi-tenanton-demand database service, in a controlled environment. Thesemechanisms and methods for providing such access can enable embodimentsto provide additional control over the development process as well asthe access of such developed applications. The ability of embodiments toprovide such additional control may lead to an improved applicationdevelopment/runtime framework, etc.

In an embodiment and by way of example, a method is provided forallowing access to developed applications via a multi-tenant on-demanddatabase service, in a controlled environment. In use, developedapplications are received at a multi-tenant on-demand database service.Access to the applications is provided to tenants of the on-demanddatabase service. Such applications are under the control of theon-demand database service.

While the present invention is described with reference to an embodimentin which techniques for allowing access to developed applications areimplemented in an application server providing a front end for amulti-tenant database on-demand service, the present invention is notlimited to multi-tenant databases or deployment on application servers.Embodiments may be practiced using other database architectures, i.e.,ORACLE®, DB2® and the like without departing from the scope of theembodiments claimed.

Any of the above embodiments may be used alone or together with oneanother in any combination. Inventions encompassed within thisspecification may also include embodiments that are only partiallymentioned or alluded to or are not mentioned or alluded to at all inthis brief summary or in the abstract. Although various embodiments ofthe invention may have been motivated by various deficiencies with theprior art, which may be discussed or alluded to in one or more places inthe specification, the embodiments of the invention do not necessarilyaddress any of these deficiencies. In other words, different embodimentsof the invention may address different deficiencies that may bediscussed in the specification. Some embodiments may only partiallyaddress some deficiencies or just one deficiency that may be discussedin the specification, and some embodiments may not address any of thesedeficiencies.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A illustrates a system for allowing access to developedapplications via an on-demand database service, in accordance with oneembodiment.

FIG. 1B shows a method for testing developed applications utilizing anon-demand database service.

FIG. 2 shows a method for extending an interface that executes with anon-demand database service.

FIG. 3 shows a system for allowing access to developed applications viaan on-demand database service, in accordance with another embodiment.

FIG. 4 shows a method for receiving and processing script from adeveloper, in accordance with yet another embodiment.

FIG. 5 shows a method for receiving and processing requests from an enduser, in accordance with still yet another embodiment.

FIG. 6 illustrates a block diagram of an example of an environmentwherein an on-demand database service might be used.

FIG. 7 illustrates a block diagram of an embodiment of elements of FIG.6 and various possible interconnections between these elements.

DETAILED DESCRIPTION General Overview

Systems and methods are provided for allowing access to developedapplications via a multi-tenant on-demand database service, in acontrolled environment. Further, systems and methods are provided forextending an interface that executes with the on-demand databaseservice.

In the development of applications for use with database systems, manychallenges exist that result from die fact that the control of suchapplication development rests with the developer. For example, variousdevelopment best practices (e.g. with respect to testing, resourceallocation, etc.) are not necessarily enforced, since they are under thecontrol of the developer. Thus, mechanisms and methods are providedherein for allowing access to developed applications via a multi-tenanton-demand database service, in a controlled environment. The ability ofembodiments to provide such additional control may lead to an improveddevelopment/runtime framework, etc. For example, by administeringcontrol over the development process, etc., embodiments are enabledwhereby interfaces (e.g. API's, etc.) may be extended in a moreaffective manner.

Next, mechanisms and methods will be described for allowing access todeveloped applications in a controlled environment, as well as extendingan interface that executes with an on-demand database service.

FIG. 1A illustrates a system 100 for allowing access to developedapplications via an on-demand database service 102, in accordance withone embodiment. In the context of the present description, an on-demanddatabase service may include any service that relies on a databasesystem that is accessible over a network.

In one embodiment, the on-demand database service 102 may include amulti-tenant on-demand database service. In the present description,such multi-tenant on-demand database service may include any servicethat relies on a database system that is accessible over a network, inwhich various elements of hardware and software of the database systemmay be shared by one or more customers. For instance, a givenapplication server may simultaneously process requests for a greatnumber of customers, and a given database table may store rows for apotentially much greater number of customers. Various examples of such amulti-tenant on-demand database service will be set forth in the contextof different embodiments that will be described during reference tosubsequent figures.

As shown, the on-demand database service 102 communicates with aplurality of developers 104. In use, the on-demand database service 102is adapted to receive developed applications from the developers 104. Inthe context of the present description, the developers 104 may includeany one or more persons or entities (e.g. corporation, organization,etc.) that develop computer code. Further, the applications may includeany computer code (e.g. a complete program, a partial program, a codesegment, etc.).

In addition, the on-demand database service 102 communicates with one ormore tenants 106 of the on-demand database service 102. In theaforementioned embodiment where the on-demand database service 102includes a multi-tenant on-demand database service, a plurality of thetenants 106 may exist. In any case, a tenant refers to any one or morepersons or entities that are capable of accessing the on-demand databaseservice 102, in the present description. For example, the tenant(s) 106may subscribe to the on-demand database service 102.

By this design, the on-demand database service 102 serves to provideaccess to the applications to the tenant(s) 106 of the on-demanddatabase service 102. In use, the aforementioned applications are underthe control of the on-demand database service 102. By administering suchcontrol, an improved development/runtime framework, etc. is therebyprovided.

In various embodiments, such control may be administered in any desiredmanner. For example, the on-demand database service 102 may enforce anydesired policies by precluding access to applications by the tenant(s)106, in situations where the applications do not adhere to the policies.In other embodiments, the on-demand database service 102 may enforcesuch policies by precluding or limiting functionality accessible to thedevelopers 104, in such non-compliant scenario. For example, publicationof an application to the on-demand database service 102 may bedisallowed in the absence of meeting certain requirements. In onespecific embodiment, the on demand database service 102 may monitor andlimit various aspects of the applications and terminate related code,based on a dynamic contextual limiter. Of course, the foregoing controlmay be implemented in any desired manner.

In one embodiment, the aforementioned control may take the form oflimiting at least one aspect of the applications by the on-demanddatabase service 102. For instance, such aspect may relate toprocessing, storage, bandwidth, etc. resources made available to theapplications of the developers 104. By this design, the on-demanddatabase service 102 may be able constrain the developers in a way thatoptimizes the ability of the on-demand database service 102 to servicethe tenant(s) 106 via the applications.

In various embodiments, such resources-related aspect may involve adatabase associated with the on-demand database service 102, a manner inwhich such database may be accessed utilizing the applications, etc. Insuch embodiments, the foregoing aspect may include, but is not limitedto a number of columns of a database, a number of queries to a databasein a predetermined timeframe, a number of rows returned by queries, anumber of database statements (e.g. modification statements, etc.), anumber of script statements between database statements, a number ofrows processed (e.g. modified, etc.) in a predetermined timeframe, anumber of transaction statements, a total number of uncommitted rowssince a last transaction control statement, a total number of scriptstatements since a last database call, a duration of processing, etc.

Of course, such exemplary list is not to be construed as limiting. Forexample, any aspect of the on-demand database service 102 (e.g.electronic mail management, etc.) may also be limited as well. In onespecific instance, a number of e-mails one can send per request and/or anumber of outbound web service calls made per request, may be limited.In various embodiments, limits may be applied to an application on aper-request basis or on a per-time-period (e.g. per day) basis. In thelatter embodiment, such limitation may apply on a per-user or per-tenantbasis.

In other embodiments, a development of the applications may becontrolled. For example, the applications are controlled by imposingrequirements of the on-demand database service 102 that the applicationsbe tested (e.g. validated, etc.). Such testing may, in one embodiment,be natively run in an automated manner, by way of a call made to anapplication program interface associated with the on-demand databaseservice 102.

In other aspects of the present embodiment involving developmentcontrols, the on-demand database service 102 may require that functionaltests be written for applications and further require a predeterminedpercentage of code coverage. In this embodiment, such technique mayallow one to run such tests whenever the on-demand database service 102is modified, to reduce the risk of accidentally breaking workingapplications. By this design, regression and/or any other negativetraits may be avoided. More information regarding one possibleembodiment involving such controlled testing will be set forth ingreater detail during reference to FIG. 1B.

in still additional embodiments, access to the applications by thetenant(s) 106 of the on-demand database service 102 may be controlled.For instance, a single instance of each application may be instantiatedamong a plurality of the tenant(s) 106 of the on-demand database service102. Thus, only a single copy of the application need be stored by theon-demand database service 102, and simultaneously shared amongst thetenant(s) 106 in the foregoing manner.

It should be that the forgoing control may be static or dynamic, may ormay not be uniformly applied, etc. For example, the foregoing aspectsand related control criteria may or may not be different for differentapplications, tenants 106, etc. Just by way of example, the on-demanddatabase service 102 may allow for more resources when running anupgrade script, with respect to when running a per-row database trigger,etc. Further, the on-demand database service 102 may allow for moreresources for large tenants 106, etc.

FIG. 1B shows a method 150 for testing developed applications utilizingan on-demand database service. As an option, the present method 150 maybe implemented in the context of the on-demand database service 102 ofFIG. 1A. Of course, however, the method 150 may be carried out in anydesired environment. The aforementioned definitions may apply during thepresent description.

As shown, developed applications are received at an on-demand databaseservice. See operation 152. In various embodiments, the on-demanddatabase service may or may not include a multi-tenant on-demanddatabase service.

Further, the developed applications may be received in whole or in part.For example, in one embodiment, an application may be developedutilizing a separate system and may be subsequently uploaded to theon-demand database service. In other embodiments, code segments of theapplication may be received at the on-demand database service as theapplication is being developed. Of course, hybrid systems are furthercontemplated which employ both of the foregoing frameworks. Still yet,the aforementioned receipt of developed applications may or may notoccur over a network.

With continuing reference to FIG. 1B, the applications may be testedutilizing the on-demand database service. See operation 154. In thecontext of the present description, such testing may relate to anyprocess for assessing at least one aspect of the applications. Forexample, such aspect may include, but is not limited to operability,quality, efficiency (e.g. with respect to resource requirements, etc.),etc. in various different embodiments, the testing may be for debuggingpurposes, identifying unwanted deadlock situations, enforcing databasesemantics, and/or any desired rules, for that matter.

In a particular embodiment, the foregoing testing may involve a unittest. Such unit test may verify whether a particular piece of code of anapplication is working properly. As an option, the unit test may take noarguments, commit no data to a database, etc. In other embodiments,tests may be employed which cover as many lines of code as possible,and, in the case of conditional logic (including ternary operators),execute each branch of code logic. Further, the tests may be designed tocomplete successfully without throwing any exceptions, unless thoseerrors are expected and caught. Still yet, tests may be configured toliberally make use of “System.assert( )” methods to prove that codebehaves properly, exercise bulk trigger functionality, etc.

In one embodiment, the testing may be controlled by the on-demanddatabase service. For example, all testing may be under the control ofthe on-demand database service. In other embodiments, only some of thetesting may be under the control of the on-demand database service. Insuch embodiment, a first subset of the testing may be controlled bydevelopers of the applications, and a second subset of the testing maybe controlled by the on-demand database service.

Further, the testing may occur at any desired time. For instance, thetesting may be periodic, on-demand, triggered by an event or milestone,etc. In one example, the testing may occur automatically across allrelevant applications upon at least one aspect (e.g. code, feature,etc.) of the on-demand database service being added, upgraded, etc. Tothis end, continued operation of the applications on the on-demanddatabase service is ensured.

In another embodiment, the testing may be required by the on-demanddatabase service. Such requirement may be enforced in any desired manner(e.g. see, again, the aforementioned exemplary enforcement techniques,etc.). As an option, it may be determined whether at least one of theapplications has passed the testing. To this end, access to suchapplication(s) may be conditionally provided, based on thedetermination. For example, access may be provided to theapplication(s), if it is determined that the application(s) has passedthe testing. Further, such access to the application(s) may beprecluded, if it is determined that the application(s) has not passedthe testing. As an option, a report may be provided to indicate anextent and/or manner in which the testing was passed or failed, so thatappropriate action may be taken by the application developer.

A definition of requirements for such pass may be configured in anydesired manner. For example, such pass criteria may be defined by theon-demand database service. Further, the criteria may involve anydesired parameters, thresholds, etc. To this end, a managed codeenvironment is provided that requires application developers to give upsome control over the development process, in exchange for the benefitof standardized improvements in applications available via the on-demanddatabase service.

FIG. 2 shows a method 200 for extending an interface that executes withan on-demand database service. As an option, the present method 200 maybe implemented in the context of the on-demand database service 102 ofFIG. 1A. In various embodiments, the on-demand database service may ormay not include a multi-tenant on-demand database service. Of course,however, the method 200 may be carried out in any desired environment.The aforementioned definitions may apply during the present description.

As shown, at least one programming language instruction is received at aplatform on which applications can be built. See operation 202. Thereceipt of such instruction may be accomplished in any desired manner.For example, the at least one programming language instruction may ormay not be received at an API associated with the platform.

In various embodiments, such platform may or may not be part of theon-demand database service 102 of FIG. 1, and may be adapted for sharingapplications. It should be noted, however, the platform may include anyhardware and/or software that is capable of allowing applications to bebuilt. Of course, such applications may or may not be built by thirdparties (e.g. parties other than that associated with the platform,etc.).

In the context of the present description, the foregoing applicationsmay include any desired software, and such application may be built inany desired manner. For example, in various embodiments, such “building”may range from providing a forum to manage the entire or a portion ofthe development process, to simply making a pre-existing applicationaccessible for use, etc. Still yet, in the present description, theaforementioned programming language instruction may include any piece ofcode recognizable by the platform.

With continuing reference to FIG. 2, a set of instructions to anon-demand database service may be prepared, based on the at least oneprogramming language instruction. See operation 204. In the context ofthe present description, the set of instructions may include any codethat is recognizable by the on-demand database service.

In other embodiments where the on-demand database service has theability to call out to other external systems, the set of instructionsmay refer to instructions to another system via the on-demand databaseservice. More information regarding such call out feature may be foundwith reference to U.S. patent application Ser. No. 11/778,587 entitled“METHOD AND SYSTEM FOR PROVIDING A CLIENT ACCESS TO AN EXTERNAL SERVICEVIA AN APPLICATION SERVICES PLATFORM,” by Manoj Cheenath et al., filedJul. 16, 2007 (Attorney Docket No. SFC1P004_(—)035), the entire contentsof which are incorporated herein by reference. Further, theaforementioned controls may be applied to any call out request to suchexternal systems. For example, such call out request may be given alower priority (e.g. disallowed during a low level database operationsinvolving locks, etc.).

In one embodiment involving a multi-tenant on-demand database service,the set of instructions may be configured to be applied to all tenants.In another embodiment, the set of instructions may be tenant-specific.In other words, the set of instructions may be prepared to query forinformation related to a single tenant (or subset of tenants) selectedfrom the tenants storing data utilizing the on-demand database service.

To this end, the set of instructions may be applied (e.g. to theon-demand database service) to affect a result, in accordance with theprogramming language instruction. See operation 206. In variousembodiments, the set of instructions may be applied to provide a resultset from the on-demand database service, updating data in the on-demanddatabase service, and/or performing any desired action or altering anexisting action, in accordance with the programming languageinstruction. In one particular embodiment, the set of instructions maybe applied to extend an interface (e.g. API, graphical user interface,etc.) of the on-demand database service in any desired manner.

Various possible features may be enabled by the foregoing extensiontechnique. In one embodiment, the set of instructions may be applied torun a set of multi-object manipulations at the on-demand databaseservice responsive to a single transaction. For example, themanipulation of multiple objects which previously required multipletransactions, may, after the extension, require a single transaction.

An example of the method 200 of FIG. 2 will now be set forth in thecontext of the on-demand database service 102 of FIG. 1A thatincorporates the aforementioned platform. In such example, theinstruction of operation 202 may be received at the on-demand databaseservice 102 from the developer 104. Thereafter, the on-demand databaseservice 102 may prepare the set of instructions of operation 204. Tothis end, such set of instructions of operation 204 may be applied bythe on-demand database service 102, in conjunction with use of anapplication by the tenant(s) 106. By this design, any desired aspect ofthe on-demand database service 102 (e.g. one of the applications, etc.)may be extended in accordance with the original the instruction receivedfrom the developer 104.

In some embodiments, the programming language instruction may include aformat, syntax, etc. that is tailored for use with a database system. Inone specific embodiment, a procedural language salesforce object querylanguage (PL/SOQL) programming language instruction may be employed. Inthe present embodiment, the PL/SOQL is capable of serving as aprocedural extension to an on-demand database centric service API thatallows flow control and transaction control to execute on a server inconjunction with database APIs [e.g. SOQL, data manipulation language(DML), etc.]. The PL/SOQL can enable the capability to thread togethermultiple SOQL/DML statements as a single unit of work on the server. ThePL/SOQL need not necessarily be considered a general purpose programminglanguage, as it is heavily data focused, in some embodiments. It may, inone optional embodiment, be used by developers to interface with anon-demand database system, in contrast to traditional applicationdevelopers' conventional tools, such as PL/SQL by Oracle®, Inc. ofRedwood Shores, Calif. and others.

The present PL/SOQL embodiment may also include syntax and semanticsintended to emulate that of Java, however, the present embodiment is notlimited to Java. The PL/SOQL embodiments may include variable andexpression syntax, block and conditional syntax, loop syntax, object andarray notation, pass by reference, etc. Where embedded concepts thatinterface with on-demand database applications are provided, syntax andsemantics that are easy to understand and which encourage efficient useof database APIs may also be employed.

More exemplary information regarding such PL/SOQL embodiment may befound with reference to U.S. Provisional Patent Application 60/828,757entitled “PROGRAMMING LANGUAGE METHOD AND SYSTEM FOR EXTENDING APIS TOEXECUTE IN CONJUNCTION WITH AN ON-DEMAND DATABASE SERVICE,” by CraigWeissman, filed Oct. 9, 2006 (Attorney Docket No. SFC1P009+/032PROV),and U.S. Provisional Patent Application 60/828,192 entitled “PROGRAMMINGLANGUAGE METHOD AND SYSTEM FOR EXTENDING APIS TO EXECUTE IN CONJUNCTIONWITH AN ON-DEMAND DATABASE SERVICE,” by Craig Weissman, filed Oct. 4,2006 (Attorney Docket No. SFC1P008+/032PROV), the entire contents ofwhich are incorporated herein by reference.

FIG. 3 shows a system 300 for allowing access to developed applicationsvia an on-demand database service 302, in accordance with anotherembodiment. As an option, the present system 300 may be implemented inthe context of the architecture and functionality of FIGS. 1-2. Ofcourse, however, the system 300 may be carried out in any desiredenvironment. Again, the aforementioned definitions may apply during thepresent description.

As shown, the on-demand database service 302 remains in communicationwith a developer 304 and at least one end user tenant 306 via a network308. Further, the on-demand database service 302 includes an applicationserver 310 that interfaces with the developer 304 and user tenant 306differently. Specifically, the application server 310 may interface withthe developer 304 during a compile-time phase, and the user tenant 306during a runtime phase.

For example, the application server 310 is adapted to receive programlanguage instructions (e.g. script, etc.) from the developer 304 whomay, in one embodiment, intend to extend an API of the on-demanddatabase service 302. In response to receiving such script, theapplication server 310 processes (e.g. compiles, etc.) and stores thesame in a database 312. As an option, such processing may furtherinclude any of the desired controls mentioned earlier, to make sure thatthe developer 304 employs best practices, or any other predeterminedpractices in script development. In one embodiment, such compiled scriptmay be stored in the form of metadata, for use in response to requestsfrom the end user tenant 306. By this feature, the script may be adaptedto be triggered in response to a particular associated request (e.g.request to select, access, modify, etc. an object) from the end usertenant 306.

Specifically, the application server 310 is further adapted forreceiving requests from the end user tenant 306. In response to suchrequests, they are processed utilizing a run-time interpreter 314 of theapplication server 310, by using such request to identify and retrievethe correlating compiled script from the database 312. The run-timeinterpreter 314 is further equipped with the ability to processing thecompiled script. The compiled script thus may dictate the manner inwhich the request is fulfilled, etc. As mentioned earlier, such compiledscript may allow for more efficient retrieval of database information,and/or any other desired enhancement, etc.

FIG. 4 shows a method 400 for receiving and processing script from adeveloper, in accordance with another embodiment. As an option, thepresent method 400 may be implemented in the context of the architectureand functionality of FIGS. 1-3. For example, the method 400 mayrepresent functionality of the application server 310 of FIG. 3, withrespect to the developer 304. Of course, however, the method 400 may becarried out in any desired environment. Again, aforementioneddefinitions may apply during the present description.

As shown, the present method 400 is triggered upon receipt of scriptfrom a developer. See decision 402. In response to such receipt, thescript is compiled, as set forth in operation 404. In response to suchcompilation, the compiled script is stored in the form of metadata, asindicated in operation 406. To this end, the metadata is made availablefor retrieval and use in conjunction with requests by an end usertenant.

FIG. 5 shows a method 500 for receiving and processing requests from anend user, in accordance with another embodiment. As an option, thepresent method 500 may be implemented in the context of the architectureand functionality of FIGS. 1-3. For example, the method 500 mayrepresent functionality of the application server 310 of FIG. 3, withrespect to the end user tenant 306. Further, the method 500 may followthe method 400 of FIG. 4. Of course, however, the method 500 may becarried out in any desired environment. Yet gain, aforementioneddefinitions may apply during the present description.

In decisions 502, it is first determined whether a request is receivedfrom an end user tenant. If so, such request is first translated incompliance with a format, protocol, etc. that may be used to retrievemetadata stored in a database (see operation 406 of FIG. 4). Noteoperations 506-508. Such metadata may then be processed at runtime, foraffecting results returned to the end user tenant, as indicated inoperation 510.

System Overview

FIG. 6 illustrates a block diagram of an environment 610 wherein anon-demand database service might be used. As an option, any of thepreviously described embodiments of the foregoing figures may or may notbe implemented in the context of the environment 610. Environment 610may include user systems 612, network 614, system 616, processor system617, application platform 618, network interface 620, tenant datastorage 622, system data storage 624, program code 626, and processspace 628. In other embodiments, environment 610 may not have all of thecomponents listed and/or may have other elements instead of, or inaddition to, those listed above.

Environment 610 is an environment in which an on-demand database serviceexists. User system 612 may be any machine or system that is used by auser to access a database user system. For example, any of user systems612 can be a handheld computing device, a mobile phone, a laptopcomputer, a work station, and/or a network of computing devices. Asillustrated in FIG. 6 (and in more detail in FIG. 7) user systems 612might interact via a network with an on-demand database service, whichis system 616.

An on-demand database service, such as system 616, is a database systemthat is made available to outside users that do not need to necessarilybe concerned with building and/or maintaining the database system, butinstead may be available for their use when the users need the databasesystem (e.g., on the demand of the users). Some on-demand databaseservices may store information from one or more tenants stored intotables of a common database image to form a multi-tenant database system(MTS). Accordingly, “on-demand database service 616” and “system 616”will be used interchangeably herein. A database image may include one ormore database objects. A relational database management system (RDMS) orthe equivalent may execute storage and retrieval of information againstthe database object(s). Application platform 618 may be a framework thatallows the applications of system 616 to run, such as the hardwareand/or software, e.g., the operating system. In an embodiment, on-demanddatabase service 616 may include an application platform 618 thatenables creation, managing and executing one or more applicationsdeveloped by the provider of the on-demand database service, usersaccessing the on-demand database service via user systems 612, or thirdparty application developers accessing the on-demand database servicevia user systems 612.

The users of user systems 612 may differ in their respective capacities,and the capacity of a particular user system 612 might be entirelydetermined by permissions (permission levels) for the current user. Forexample, where a salesperson is using a particular user system 612 tointeract with system 616, that user system has the capacities allottedto that salesperson. However, while an administrator is using that usersystem to interact with system 616, that user system has the capacitiesallotted to that administrator. In systems with a hierarchical rolemodel, users at one permission level may have access to applications,data, and database information accessible by a lower permission leveluser, but may not have access to certain applications, databaseinformation, and data accessible by a user at a higher permission level.Thus, different users will have different capabilities with regard toaccessing and modifying application and database information, dependingon a user's security or permission level.

Network 614 is any network or combination of networks of devices thatcommunicate with one another. For example, network 614 can be any one orany combination of a LAN (local area network), WAN (wide area network),telephone network, wireless network, point-to-point network, starnetwork, token ring network, hub network, or other appropriateconfiguration. As the most common type of computer network in currentuse is a TCP/IP (Transfer Control Protocol and Internet Protocol)network, such as the global internetwork of networks often referred toas the “Internet” with a capital “I,” that network will be used in manyof the examples herein. However, it should be understood that thenetworks that the present invention might use are not so limited,although TCP/IP is a frequently implemented protocol.

User systems 612 might communicate with system 616 using TCP/IP and, ata higher network level, use other common Internet protocols tocommunicate, such as HTTP, FTP, AFS, WAP, etc. In an example where HTTPis used, user system 612 might include an HTTP client commonly referredto as a “browser” for sending and receiving HTTP messages to and from anHTTP server at system 616. Such an HTTP server might be implemented asthe sole network interface between system 616 and network 614, but othertechniques might be used as well or instead. In some implementations,the interface between system 616 and network 614 includes load sharingfunctionality, such as round-robin HTTP request distributors to balanceloads and distribute incoming HTTP requests evenly over a plurality ofservers. At least as for the users that are accessing that server, eachof the plurality of servers has access to the MTS′ data; however, otheralternative configurations may be used instead.

In one embodiment, system 616, shown in FIG. 6, implements a web-basedcustomer relationship management (CRM) system. For example, in oneembodiment, system 616 includes application servers configured toimplement and execute CRM software applications as well as providerelated data, code, forms, webpages and other information to and fromuser systems 612 and to store to, and retrieve from, a database systemrelated data, objects, and Webpage content. With a multi-tenant system,data for multiple tenants may be stored in the same physical databaseobject, however, tenant data typically is arranged so that data of onetenant is kept logically separate from that of other tenants so that onetenant does not have access to another tenant's data, unless such datais expressly shared. In certain embodiments, system 616 implementsapplications other than, or in addition to, a CRM application. Forexample, system 616 may provide tenant access to multiple hosted(standard and custom) applications, including a CRM application. User(or third party developer) applications, which may or may not includeCRM, may be supported by the application platform 618, which managescreation, storage of the applications into one or more database objectsand executing of the applications in a virtual machine in the processspace of the system 616.

One arrangement for elements of system 616 is shown in FIG. 7, includinga network interface 620, application platform 618, tenant data storage622 for tenant data 623, system data storage 624 for system dataaccessible to system 616 and possibly multiple tenants, program code 626for implementing various functions of system 616, and a process space628 for executing MTS system processes and tenant-specific processes,such as running applications as part of an application hosting service.Additional processes that may execute on system 616 include databaseindexing processes.

Several elements in the system shown in FIG. 6 include conventional,well-known elements that are explained only briefly here. For example,each user system 612 could include a desktop personal computer,workstation, laptop, PDA, cell phone, or any wireless access protocol(WAP) enabled device or any other computing device capable ofinterfacing directly or indirectly to the Internet or other networkconnection. User system 612 typically runs an HTTP client, e.g., abrowsing program, such as Microsoft's Internet Explorer browser,Netscape's Navigator browser, Opera's browser, or a WAP-enabled browserin the case of a cell phone, PDA or other wireless device, or the like,allowing a user (e.g., subscriber of the multi-tenant database system)of user system 612 to access, process and view information, pages andapplications available to it from system 616 over network 614. Each usersystem 612 also typically includes one or more user interface devices,such as a keyboard, a mouse, trackball, touch pad, touch screen, pen orthe like, for interacting with a graphical user interface (GUI) providedby the browser on a display (e.g., a monitor screen, LCD display, etc.)in conjunction with pages, forms, applications and other informationprovided by system 616 or other systems or servers. For example, theuser interface device can be used to access data and applications hostedby system 616, and to perform searches on stored data, and otherwiseallow a user to interact with various GUI pages that may be presented toa user. As discussed above, embodiments are suitable for use with theInternet, which refers to a specific global internetwork of networks.However, it should be understood that other networks can be used insteadof the Internet, such as an intranet, an extranet, a virtual privatenetwork (VPN), a non-TCP/IP based network, any LAN or WAN or the like.

According to one embodiment, each user system 612 and all of itscomponents are operator configurable using applications, such as abrowser, including computer code run using a central processing unitsuch as an Intel Pentium® processor or the like. Similarly, system 616(and additional instances of an MTS, where more than one is present) andall of their components might be operator configurable usingapplication(s) including computer code to run using a central processingunit such as processor system 617, which may include an Intel Pentium®processor or the like, and/or multiple processor units. A computerprogram product embodiment includes a machine-readable storage medium(media) having instructions stored thereon/in which can be used toprogram a computer to perform any of the processes of the embodimentsdescribed herein. Computer code for operating and configuring system 616to intercommunicate and to process webpages, applications and other dataand media content as described herein are preferably downloaded andstored on a hard disk, but the entire program code, or portions thereof,may also be stored in any other volatile or non-volatile memory mediumor device as is well known, such as a ROM or RAM, or provided on anymedia capable of storing program code, such as any type of rotatingmedia including floppy disks, optical discs, digital versatile disk(DVD), compact disk (CD), microdrive, and magneto-optical disks, andmagnetic or optical cards, nanosystems (including molecular memory ICs),or any type of media or device suitable for storing instructions and/ordata. Additionally, the entire program code, or portions thereof, may betransmitted and downloaded from a software source over a transmissionmedium, e.g., over the Internet, or from another server, as is wellknown, or transmitted over any other conventional network connection asis well known (e.g., extranet, VPN, LAN, etc.) using any communicationmedium and protocols (e.g., TCP/IP, HTTP, HTTPS, Ethernet, etc.) as arewell known. It will also be appreciated that computer code forimplementing embodiments of the present invention can be implemented inany programming language that can be executed on a client system and/orserver or server system such as, for example, C, C++, HTML, any othermarkup language, Java™, JavaScript, ActiveX, any other scriptinglanguage, such as VBScript, and many other programming languages as arewell known may be used. (Java™ is a trademark of Sun Microsystems,Inc.).

According to one embodiment, each system 616 is configured to providewebpages, forms, applications, data and media content to user (client)systems 612 to support the access by user systems 612 as tenants ofsystem 616. As such, system 616 provides security mechanisms to keepeach tenant's data separate unless the data is shared. If more than oneMTS is used, they may be located in close proximity to one another(e.g., in a server farm located in a single building or campus), or theymay be distributed at locations remote from one another (e.g., one ormore servers located in city A and one or more servers located in cityB). As used herein, each MTS could include one or more logically and/orphysically connected servers distributed locally or across one or moregeographic locations. Additionally, the term “server” is meant toinclude a computer system, including processing hardware and processspace(s), and an associated storage system and database application(e.g., OODBMS or RDBMS) as is well known in the art. It should also beunderstood that “server system” and “server” are often usedinterchangeably herein. Similarly, the database object described hereincan be implemented as single databases, a distributed database, acollection of distributed databases, a database with redundant online oroffline backups or other redundancies, etc., and might include adistributed database or storage network and associated processingintelligence.

FIG. 7 also illustrates environment 610. However, in FIG. 7 elements ofsystem 616 and various interconnections in an embodiment are furtherillustrated. FIG. 7 shows that user system 612 may include processorsystem 612A, memory system 612B, input system 612C, and output system612D. FIG. 7 shows network 614 and system 616. FIG. 7 also shows thatsystem 616 may include tenant data storage 622, tenant data 623, systemdata storage 624, system data 625, User Interface (UI) 730, ApplicationProgram interface (API) 732, PL/SOQL 734, save routines 736, applicationsetup mechanism 738, applications servers 1000 ₁-1000 _(N), systemprocess space 702, tenant process spaces 704, tenant management processspace 710, tenant storage area 712, user storage 714, and applicationmetadata 716. In other embodiments, environment 610 may not have thesame elements as those listed above and/or may have other elementsinstead of, or in addition to, those listed above.

User system 612, network 614, system 616, tenant data storage 622, andsystem data storage 624 were discussed above in FIG. 6. Regarding usersystem 612, processor system 612A may be any combination of one or moreprocessors. Memory system 612B may be any combination of one or morememory devices, short term, and/or long term memory. Input system 612Cmay be any combination of input devices, such as one or more keyboards,mice, trackballs, scanners, cameras, and/or interfaces to networks.Output system 612D may be any combination of output devices, such as oneor more monitors, printers, and/or interfaces to networks. As shown byFIG. 7, system 616 may include a network interface 620 (of FIG. 6)implemented as a set of HTTP application servers 700, an applicationplatform 618, tenant data storage 622, and system data storage 624. Alsoshown is system process space 702, including individual tenant processspaces 704 and a tenant management process space 710. Each applicationserver 1000 may be configured to tenant data storage 622 and the tenantdata 623 therein, and system data storage 624 and the system data 625therein to serve requests of user systems 612. The tenant data 623 mightbe divided into individual tenant storage areas 712, which can be eithera physical arrangement and/or a logical arrangement of data. Within eachtenant storage area 712, user storage 714 and application metadata 716might be similarly allocated for each user. For example, a copy of auser's most recently used (MRU) items might be stored to user storage714. Similarly, a copy of MRU items for an entire organization that is atenant might be stored to tenant storage area 712. A UT 730 provides auser interface and an API 732 provides an application programmerinterface to system 616 resident processes to users and/or developers atuser systems 612. The tenant data and the system data may be stored invarious databases, such as one or more Oracle™ databases.

Application platform 618 includes an application setup mechanism 738that supports application developers' creation and management ofapplications, which may be saved as metadata into tenant data storage622 by save routines 736 for execution by subscribers as one or moretenant process spaces 704 managed by tenant management process 710 forexample. Invocations to such applications may be coded using PL/SOQL 34that provides a programming language style interface extension to API732. A detailed description of some PL/SOQL language embodiments isdiscussed in commonly owned co-pending U.S. Provisional PatentApplication 60/828,192 entitled, PROGRAMMING LANGUAGE METHOD AND SYSTEMFOR EXTENDING APIS TO EXECUTE IN CONJUNCTION WITH DATABASE APIS, byCraig Weissman, filed Oct. 4, 2006, which is incorporated in itsentirety herein for all purposes. Invocations to applications may bedetected by one or more system processes, which manages retrievingapplication metadata 716 for the subscriber making the invocation andexecuting the metadata as an application in a virtual machine.

Each application server 700 may be communicably coupled to databasesystems, e.g., having access to system data 625 and tenant data 623, viaa different network connection. For example, one application server 700₁ might be coupled via the network 614 (e.g., the Internet), anotherapplication server 700 _(N-1) might be coupled via a direct networklink, and another application server 700 _(N) might be coupled by yet adifferent network connection. Transfer Control Protocol and InternetProtocol (TCP/IP) are typical protocols for communicating betweenapplication servers 700 and the database system. However, it will beapparent to one skilled in the art that other transport protocols may beused to optimize the system depending on the network interconnect used.

In certain embodiments, each application server 700 is configured tohandle requests for any user associated with any organization that is atenant. Because it is desirable to be able to add and remove applicationservers from the server pool at any time for any reason, there ispreferably no server affinity for a user and/or organization to aspecific application server 700. In one embodiment, therefore, aninterface system implementing a load balancing function (e.g., an F5Big-IP load balancer) is communicably coupled between the applicationservers 700 and the user systems 612 to distribute requests to theapplication servers 700. In one embodiment, the load balancer uses aleast connections algorithm to route user requests to the applicationservers 700. Other examples of load balancing algorithms, such as roundrobin and observed response time, also can be used. For example, incertain embodiments, three consecutive requests from the same user couldhit three different application servers 700, and three requests fromdifferent users could hit the same application server 700. In thismanner, system 616 is multi-tenant, wherein system 616 handles storageof, and access to, different objects, data and applications acrossdisparate users and organizations.

As an example of storage, one tenant might be a company that employs asales force where each salesperson uses system 616 to manage their salesprocess. Thus, a user might maintain contact data, leads data, customerfollow-up data, performance data, goals and progress data, etc., allapplicable to that user's personal sales process (e.g., in tenant datastorage 622). In an example of a MTS arrangement, since all of the dataand the applications to access, view, modify, report, transmit,calculate, etc., can be maintained and accessed by a user system havingnothing more than network access, the user can manage his or her salesefforts and cycles from any of many different user systems. For example,if a salesperson is visiting a customer and the customer has Internetaccess in their lobby, the salesperson can obtain critical updates as tothat customer while waiting for the customer to arrive in the lobby.

While each user's data might be separate from other users' dataregardless of the employers of each user, some data might beorganization-wide data shared or accessible by a plurality of users orall of the users for a given organization that is a tenant. Thus, theremight be some data structures managed by system 616 that are allocatedat the tenant level while other data structures might be managed at theuser level. Because an MTS might support multiple tenants includingpossible competitors, the MTS should have security protocols that keepdata, applications, and application use separate. Also, because manytenants may opt for access to an MTS rather than maintain their ownsystem, redundancy, up-time, and backup are additional functions thatmay be implemented in the MTS. In addition to user-specific data andtenant-specific data, system 616 might also maintain system level datausable by multiple tenants or other data. Such system level data mightinclude industry reports, news, postings, and the like that are sharableamong tenants.

In certain embodiments, user systems 612 (which may be client systems)communicate with application servers 700 to request and updatesystem-level and tenant-level data from system 616 that may requiresending one or more queries to tenant data storage 622 and/or systemdata storage 624. System 616 (e.g., an application server 700 in system616) automatically generates one or more. SQL statements (e.g., one ormore SQL queries) that are designed to access the desired information.System data storage 624 may generate query plans to access the requesteddata from the database.

Each database can generally be viewed as a collection of objects, suchas a set of logical tables, containing data fitted into predefinedcategories. A “table” is one representation of a data object, and may beused herein to simplify the conceptual description of objects and customobjects according to the present invention. It should be understood that“table” and “object” may be used interchangeably herein. Each tablegenerally contains one or more data categories logically arranged ascolumns or fields in a viewable schema. Each row or record of a tablecontains an instance of data for each category defined by the fields.For example, a CRM database may include a table that describes acustomer with fields for basic contact information such as name,address, phone number, fax number, etc. Another table might describe apurchase order, including fields for information such as customer,product, sale price, date, etc. In some multi-tenant database systems,standard entity tables might be provided for use by all tenants. For CRMdatabase applications, such standard entities might include tables forAccount, Contact, Lead, and Opportunity data, each containingpre-defined fields. It should be understood that the word “entity” mayalso be used interchangeably herein with “object” and “table”.

In some multi-tenant database systems, tenants may be allowed to createand store custom objects, or they may be allowed to customize standardentities or objects, for example by creating custom fields for standardobjects, including custom index fields. U.S. patent application Ser. No.10/817,161, filed Apr. 2, 2004, entitled “Custom Entities and Fields ina Multi-Tenant Database System”, and which is hereby incorporated hereinby reference, teaches systems and methods for creating custom objects aswell as customizing standard objects in a multi-tenant database system.In certain embodiments, for example, all custom entity data rows arestored in a single multi-tenant physical table, which may containmultiple logical tables per organization. It is transparent to customersthat their multiple “tables” are in fact stored in one large table orthat their data may be stored in the same table as the data of othercustomers.

While the invention has been described by way of example and in terms ofthe specific embodiments, it is to be understood that the invention isnot limited to the disclosed embodiments. To the contrary, it isintended to cover various modifications and similar arrangements aswould be apparent to those skilled in the art. Therefore, the scope ofthe appended claims should be accorded the broadest interpretation so asto encompass all such modifications and similar arrangements.

1. A method, comprising: receiving, at a platform on which applicationscan be built, at least one programming language instruction; preparing,based on the at least one programming language instruction, a set ofinstructions to an on-demand database service; and applying the set ofinstructions to the on-demand database service to affect a result, inaccordance with the programming language instruction.
 2. The method ofclaim 1, wherein the set of instructions is applied to extend aninterface.
 3. The method of claim 2, wherein the interface includes anapplication program interface.
 4. The method of claim 2, wherein theinterface includes a graphical user interface.
 5. The method of claim 1,wherein the set of instructions is applied to provide a result set fromthe on-demand database service, in accordance with the programminglanguage instruction.
 6. The method of claim 1, wherein the set ofinstructions is applied to update data in the on-demand databaseservice, in accordance with the programming language instruction.
 7. Themethod of claim 1, wherein the set of instructions is applied to run aset of multi-object manipulations at the on-demand database serviceresponsive to a single transaction.
 8. The method of claim 1, whereinthe applications are built by third parties.
 9. The method of claim 1,wherein the at least one programming language instruction includes aPL/SOQL language instruction.
 10. The method of claim 1, wherein the atleast one programming language instruction is received at an applicationprogram interface of the platform.
 11. The method of claim 1, whereinthe platform is adapted for sharing the applications.
 12. The method ofclaim 1, wherein the on-demand database service includes a multi-tenanton-demand database service.
 13. The method of claim 1, wherein the setof instructions are prepared to query for information related to atenant selected from a plurality of tenants storing data utilizing theon-demand database service.
 14. The method of claim 1, wherein theplatform allows developers to upload the applications, and allowstenants of the on-demand database service to use the uploadedapplications.
 15. The method of claim 14, wherein the uploadedapplications are under the control of the on-demand database service.16. A method, comprising: receiving, at a platform on which applicationscan be built, at least one programming language instruction; preparing,based on the at least one programming language instruction, a set ofinstructions to another system via an on-demand database service; andapplying the set of instructions to affect a result, in accordance withthe programming language instruction.
 17. The method of claim 16,wherein the other system includes an external system.
 18. Amachine-readable medium carrying one or more sequences of instructionswhich, when executed by one or more processors, cause the one or moreprocessors to carry out the steps of: receiving, at a platform on whichapplications can be built, at least one programming languageinstruction; preparing, based on the at least one programming languageinstruction, a set of instructions to an on-demand database service; andapplying the set of instructions to the on-demand database service toaffect a result, in accordance with the programming languageinstruction.
 19. An apparatus, comprising: a processor; and one or morestored sequences of instructions which, when executed by the processor,cause the processor to carry out the steps of: receiving, at a platformon which applications can be built, at least one programming languageinstruction; preparing, based on the at least one programming languageinstruction, a set of instructions to an on-demand database service; andapplying the set of instructions to the on-demand database service toaffect a result, in accordance with the programming languageinstruction.
 20. A method for transmitting code for use in amulti-tenant database system on a transmission medium, the methodcomprising: transmitting code to receive, at a platform on whichapplications can be built, at least one programming languageinstruction; transmitting code to prepare, based on the at least oneprogramming language instruction, a set of instructions to an on-demanddatabase service; and transmitting code to apply the set of instructionsto the on-demand database service to affect a result, in accordance withthe programming language instruction.